package com.logic.meeting.app.util;

import android.content.Context;

import com.ys.rkapi.MyManager;


public class LekUtil {
    public static void setLekLight(Context context, String color) {

        final MyManager mymanager = MyManager.getInstance(context);
        mymanager.upgradeRootPermissionForExport();
        final String b = mymanager.getAndroidModle();

        if (color.equals("red")) {
            if (b.contains("3368")) {
                GpioUtils.writeGpioValue(90, "0");//蓝色
                GpioUtils.writeGpioValue(111, "0");//红色
                GpioUtils.writeGpioValue(109, "0");//绿色

                GpioUtils.writeGpioValue(111, "1");
            } else if (b.contains("3288")) {
                GpioUtils.writeGpioValue(68, "0");//蓝色
                GpioUtils.writeGpioValue(69, "0");//绿色
                GpioUtils.writeGpioValue(138, "0");//红色

                GpioUtils.writeGpioValue(138, "1");
            } else if (b.contains("3128")) {

                GpioUtils.writeGpioValue(12, "0");//蓝色
                GpioUtils.writeGpioValue(11, "0");//绿色
                GpioUtils.writeGpioValue(13, "0");//红色

                GpioUtils.writeGpioValue(13, "1");
            } else if (b.contains("3568")) {

                mymanager.writeGpioValue(1, "0");//红色
                mymanager.writeGpioValue(2, "0");//绿色
                mymanager.writeGpioValue(3, "0");//蓝色

                mymanager.writeGpioValue(1, "1");
            }
        } else if (color.equals("green")) {
            if (b.contains("3368")) {
                GpioUtils.writeGpioValue(90, "0");//蓝色
                GpioUtils.writeGpioValue(111, "0");//红色
                GpioUtils.writeGpioValue(109, "0");//绿色

                GpioUtils.writeGpioValue(109, "1");
            } else if (b.contains("3288")) {
                GpioUtils.writeGpioValue(68, "0");//蓝色
                GpioUtils.writeGpioValue(69, "0");//绿色
                GpioUtils.writeGpioValue(138, "0");//红色

                GpioUtils.writeGpioValue(69, "1");
            } else if (b.contains("3128")) {

                GpioUtils.writeGpioValue(12, "0");//绿色
                GpioUtils.writeGpioValue(11, "0");//绿色
                GpioUtils.writeGpioValue(13, "0");//红色

                GpioUtils.writeGpioValue(11, "1");
            } else if (b.contains("3568")) {

                mymanager.writeGpioValue(1, "0");//红色
                mymanager.writeGpioValue(2, "0");//绿色
                mymanager.writeGpioValue(3, "0");//蓝色

                mymanager.writeGpioValue(2, "1");
            }
        } else if (color.equals("blue")) {
            if (b.contains("3368")) {
                GpioUtils.writeGpioValue(90, "0");//蓝色
                GpioUtils.writeGpioValue(111, "0");//红色
                GpioUtils.writeGpioValue(109, "0");//绿色

                GpioUtils.writeGpioValue(109, "1");
            } else if (b.contains("3288")) {
                GpioUtils.writeGpioValue(68, "0");//蓝色
                GpioUtils.writeGpioValue(69, "0");//绿色
                GpioUtils.writeGpioValue(138, "0");//红色

                GpioUtils.writeGpioValue(69, "1");
            } else if (b.contains("3128")) {

                GpioUtils.writeGpioValue(12, "0");//绿色
                GpioUtils.writeGpioValue(11, "0");//绿色
                GpioUtils.writeGpioValue(13, "0");//红色

                GpioUtils.writeGpioValue(11, "1");
            } else if (b.contains("3568")) {

                mymanager.writeGpioValue(1, "0");//红色
                mymanager.writeGpioValue(2, "0");//绿色
                mymanager.writeGpioValue(3, "0");//蓝色

                mymanager.writeGpioValue(2, "1");
            }
        }

    }
}
